Google News
logo
jQuery - Interview Questions
Can you use multiple document.ready() function on the same page?
Yes. You can use any number of document.ready() function on the same page.

Example :
 
$(document).ready(function() {    
$("h1").css("background-color", "red");    
 });    
$(document).ready(function() {    
$("p").css("background-color", "blue");    
 }); 
Advertisement